/*
 * @Date: 2019-11-06 10:43:27
 * @LastEditors: peng qiao
 * @LastEditTime: 2020-03-20 16:34:58
 */
/* eslint-disable */
import http from './Common/http.js'
import constant from '@/controller/constant.js'

export default {
  // 登录
  security_v1_login: async function (data) {
    const res = await http.post(constant.BASE_URL + '/security/v1/login', data)
    return res
  },
  // 注册
  security_v1_register: async function (data) {
    const res = await http.post(constant.BASE_URL + '/security/v1/register', data)
    return res
  },
  // 忘记密码
  security_v1_forgetPassword: async function (data) {
    const res = await http.post(constant.BASE_URL + '/security/v1/forgetPassword', data)
    return res
  },
  // 获取验证码
  user_v1_msg_code: async function (phone) {
    const res = await http.post(constant.BASE_URL + '/sms/v1/msg/code/' + phone)
    return res
  },
  // 验证码登录
  security_v1_msgLogin: async function (data) {
    const res = await http.post(constant.BASE_URL + '/security/v1/msgLogin', data)
    return res
  },
  // 查询当前登录用户首页应用
  userApp_v1_findOwn: async function () {
    const res = await http.get(constant.BASE_URL + '/userApp/v1/findOwn')
    return res
  },
  // 保存首页应用
  userApp_v1_save: async function (data) {
    const res = await http.post(constant.BASE_URL + '/userApp/v1/save', data)
    return res
  },
  // 首页公告查询
  announcements_v1_list_frontEnd: async function (data) {
    const res = await http.post(constant.BASE_URL + '/announcements/v1/list/frontEnd', data)
    return res
  },
  // 公告详情
  announcements_v1_get: async function (data) {
    const res = await http.get(constant.BASE_URL + '/announcements/v1/get/'+data)
    return res
  },
  // 首页轮播图查询
  banner_v1_list_frontEnd: async function (data) {
    const res = await http.post(constant.BASE_URL + '/banner/v1/list/frontEnd', data)
    return res
  },
  // 首页动态查询
  communityAffairs_v1_list_frontEnd: async function (data) {
    const res = await http.post(constant.BASE_URL + '/communityAffairs/v1/list/frontEnd', data)
    return res
  },
  // 首页动态详情
  communityAffairs_v1_get: async function (data) {
    const res = await http.get(constant.BASE_URL + '/communityAffairs/v1/get/' + data)
    return res
  },
  // 根据区编码查询社区
  community_community_code_code: async function (id) {
    const res = await http.get(constant.BASE_URL + '/community/community/code/' + id)
    return res
  },
  // 条件查询子行政区划，省级的父编码为‘-1’
  region_v1_find_list: async function (data) {
    const res = await http.get(constant.BASE_URL + '/region/v1/findList', data)
    return res
  },
  // 根据行政区划级别查询行政区划，1：省，2：市，3，区县，4，街道
  region_v1_find_by_level: async function (data) {
    const res = await http.get(constant.BASE_URL + '/region/v1/findByLevel/', data)
    return res
  },
  // 获取小区详情
  community_neighborhood_by_id: async function (id) {
    const res = await http.get(constant.BASE_URL + '/community/neighborhood/'+id)
    return res
  },
  // 查询用户社区列表
  user_property_v1_find_user_neighborhood_list: async function () {
    const res = await http.get(constant.BASE_URL + '/userProperty/v1/findUserNeighborhoodList')
    return res
  },
  // 选择小区
  user_property_v1_select_neighborhood: async function (id) {
    const res = await http.get(constant.BASE_URL + '/userProperty/v1/selectNeighborhood',{neighborhoodId: id})
    return res
  },
  // 分页查询小区
  community_neighborhood_page: async function (data) {
    const res = await http.post(constant.BASE_URL + '/community/neighborhood/page', data)
    return res
  },
}